<?php
defined('IN_IXDCW') or exit('Access Denied');
include tpl('header');
show_menu($menus);
?>
<form action="?">
    <div class="tt"><?php echo $MOD['name'];?>搜索</div>
    <input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/>
    <input type="hidden" name="action" value="<?php echo $action;?>"/>
    <table cellpadding="2" cellspacing="1" class="tb">
        <tr>
            <td>
                &nbsp;<?php echo $fields_select;?>&nbsp;
                <input type="text" size="30" name="kw" value="<?php echo $kw;?>" title="关键词"/>&nbsp;
				<?php echo $level_select;?>&nbsp;
				<?php echo $order_select;?>&nbsp;
                <input type="text" name="psize" value="<?php echo $pagesize;?>" size="2" class="t_c" title="条/页"/>
                <input type="submit" value="搜 索" class="btn"/>&nbsp;
                <input type="button" value="重 置" class="btn" onclick="window.location='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=<?php echo $action;?>';"/>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;<select name="datetype">
                <option value="edittime" <?php if ($datetype == 'edittime') echo 'selected';?>>更新日期</option>
                <option value="addtime" <?php if ($datetype == 'addtime') echo 'selected';?>>发布日期</option>
            </select>&nbsp;
				<?php echo dcalendar('fromdate', $fromdate, '');?> 至 <?php echo dcalendar('todate', $todate, '');?>&nbsp;
				<?php echo $_admin == 1 ? category_select('catid', '不限分类', $catid, $moduleid) : ajax_category_select('catid', '不限分类', $catid, $moduleid);?>&nbsp;
                ID：<input type="text" size="4" name="id" value="<?php echo $id;?>"/>&nbsp;
                <input type="checkbox" name="thumb" value="1"<?php echo $thumb ? ' checked' : '';?>/>图片&nbsp;
                <input type="checkbox" name="link" value="1"<?php echo $link ? ' checked' : '';?>/>外链&nbsp;
                <input type="checkbox" name="guest" value="1"<?php echo $guest ? ' checked' : '';?>/>游客&nbsp;
            </td>
        </tr>
    </table>
</form>
<form method="post">
    <div class="tt"><?php echo $menus[$menuid][0];?></div>
    <table cellpadding="2" cellspacing="1" class="tb">
        <tr>
            <th width="25"><input type="checkbox" onclick="checkall(this.form);"/></th>
            <th>id</th>
            <th width="60">日期</th>
            <th>奖 项 名 称</th>
            <th>发出数量</th>
            <th width="120">总数量</th>
            <th>总花费钱数</th>

        </tr>
		<?php foreach ($lists as $k => $v) { ?>
        <tr onmouseover="this.className='on';" onmouseout="this.className='';" align="center">
            <td><input type="checkbox" name="id[]" value="<?php echo $v['id'];?>"/></td>

            <td><?php echo $v['id'];?></td>
            <td width="120px"><?php echo $v['date'];?></td>
            <td><?php echo $v['name'];?></td>
            <td>
				<?php echo $v['used']  ?>
            </td>

            <td class="px11"><?php echo $v['mount'];?></td>

            <td class="px11"><?php echo $v['printmoney'];?></td>

        </tr>
		<?php }?>
    </table>
    <div class="btns">

		<?php if ($action == 'check') { ?>

        <input type="submit" value=" 通过审核 " class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=check';"/>&nbsp;
        <input type="submit" value=" 拒 绝 " class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=reject';"/>&nbsp;
        <input type="submit" value=" 移动分类 " class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=move';"/>&nbsp;
        <input type="submit" value=" 回收站 " class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/>&nbsp;
        <input type="submit" value=" 彻底删除 " class="btn" onclick="if(confirm('确定要删除选中<?php echo $MOD['name'];?>吗？此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/>

		<?php } else if ($action == 'reject') { ?>

        <input type="submit" value=" 回收站 " class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/>&nbsp;
        <input type="submit" value=" 彻底删除 " class="btn" onclick="if(confirm('确定要删除选中<?php echo $MOD['name'];?>吗？此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/>

		<?php } else if ($action == 'recycle') { ?>

        <input type="submit" value=" 彻底删除 " class="btn" onclick="if(confirm('确定要删除选中<?php echo $MOD['name'];?>吗？此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/>&nbsp;
        <input type="submit" value=" 还 原 " class="btn" onclick="if(confirm('确定要还原选中<?php echo $MOD['name'];?>吗？状态将被设置为已通过')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=restore'}else{return false;}"/>&nbsp;
        <input type="submit" value=" 清 空 " class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=clear';"/>

		<?php } else { ?>

        <input type="submit" value=" 更新信息 " class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=update';"/>&nbsp;
        <input type="submit" value=" 生成网页 " class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=tohtml';"/>&nbsp;
        <input type="submit" value=" 回收站 " class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/>&nbsp;
        <input type="submit" value=" 彻底删除 " class="btn" onclick="if(confirm('确定要删除选中<?php echo $MOD['name'];?>吗？此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/>&nbsp;
        <input type="submit" value=" 移动分类 " class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=move';"/>&nbsp;
        <input type="submit" value=" 一键生成 " class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=html&action=all';" title="生成该模块所有网页"/>&nbsp;
        <input type="submit" value=" 更新所有 " class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=html&action=show&update=1';" title="更新该模块所有信息地址等项目"/>&nbsp;
		<?php echo level_select('level', '设置级别为</option><option value="0">取消', 0, 'onchange="this.form.action=\'?moduleid=' . $moduleid . '&file=' . $file . '&action=level\';this.form.submit();"'); ?>

		<?php } ?>

    </div>
</form>
	<div class="pages"><?php echo  $do_statistics->getPn()->render();?></br>
	<span>共<?php echo $items;?>条/<?php echo $do_statistics->getPn()->getPages();?>页&nbsp;
		<?php if ($do_statistics->getPn()->getPages()>1){;?>
		到第</span>
		<input type="text" name="page-num-input" id="xd_page_jump"/>
		<span>页</span>
		<button type="submit" onclick="xdChangeAndLocation('page', $('#xd_page_jump').val())">确定</button>
		<?php };?>
	</div>
<br/>
<script type="text/javascript">Menuon(<?php echo $menuid;?>);</script>
<?php include tpl('footer'); ?>